package com.trade.module.base.repository;

import com.trade.module.base.entity.Dictionary;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Class Description: 数据字典数据持久层
 *
 * @Version v1.0 2017/4/25 23:09
 * @JDK version 1.8.0_51
 * @Author zfb
 */
@Repository
public interface DictionaryRepository extends PagingAndSortingRepository<Dictionary,String>,
        JpaSpecificationExecutor<Dictionary>{
    /**
     * 查询所有已经被删除的字典值
     *
     * @param dataFlag 数据删除状态
     * @return List<Dictionary>
     */
    List<Dictionary> findByDataFlag(String dataFlag);

    /**
     * 根据父id查询字典值
     *
     * @param dicId 父id
     * @return List<Dictionary>
     */
    List<Dictionary> findByDicParentId(String dicId);
}
